<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<FiltronASP.Areas.Admin.ViewModels.Menus.MenusEditionViewModel>" ValidateRequest="false" %>
<%@ Import Namespace="FiltronASP.Helpers.HtmlTags" %>
<%@ Import Namespace="FiltronASP.Helpers.Routes" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Nowa pozycja menu
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

          
    <% Html.BeginForm("CreateNewMenuItem", "Menus", FormMethod.Post, new {name = "menuForm" }); %>
        <% Html.RenderPartial("MenuItemEditionFields"); %>
        <div class="right-page-buttons"> 
  			<span class="button2" onclick="document.forms['cancelNewItemForm'].submit();">Anuluj</span> 
  			<span class="button2" onclick="document.forms['menuForm'].submit();">Zapisz</span> 
        </div>
    <% Html.EndForm(); %>  

    <% Html.BeginForm("CancelNewItem", "Menus", FormMethod.Post, new { name = "cancelNewItemForm" }); %>
        <%= Html.HiddenFor(m => Model.MenuItemToOperateWith.item_id) %>
        <%= Html.HiddenFor(m => Model.MenuItemToOperateWith.item_type_id) %>
        <%= Html.HiddenFor(m => Model.MenuItemToOperateWith.parent_item_id) %>
        <%= Html.HiddenFor(m => Model.PaginationPage) %>
        <% if (Model.CurrentMenu != null) { %>
            <%= Html.HiddenFor(m => Model.CurrentMenu.menu_id)%>
        <% } //if menu id %>
        <% if (Model.CurrentLanguage != null) { %>
            <%= Html.HiddenFor(m => Model.CurrentLanguage.language_id) %>
        <% } //if lang %>
	<% Html.EndForm(); %>    

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="HeaderContent" runat="server">



    <% if (Model.MenuItemToOperateWith.MenuItemType != null) { %>
        <% if (!(String.IsNullOrEmpty(Model.MenuItemToOperateWith.MenuItemType.type_img))) { %>                                   
            <img src="<%= Url.GenerateAdminImageLink(Model.MenuItemToOperateWith.MenuItemType.type_img) %>" alt=" " />
        <% } //if img %>
        <% if (!(String.IsNullOrEmpty(Model.MenuItemToOperateWith.item_path))) { %>     
            <%= Model.MenuItemToOperateWith.item_path %>
        <% } //if path %>        
    <% } //if not null %>                                    
</asp:Content>
